# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1WebKeySettings do
  @moduledoc """
  Settings specific to keys that can be used by websites.

  ## Attributes

  *   `allowAllDomains` (*type:* `boolean()`, *default:* `nil`) - Optional. If set to true, it means allowed_domains are not enforced.
  *   `allowAmpTraffic` (*type:* `boolean()`, *default:* `nil`) - Optional. If set to true, the key can be used on AMP (Accelerated Mobile Pages) websites. This is supported only for the SCORE integration type.
  *   `allowedDomains` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Domains or subdomains of websites allowed to use the key. All subdomains of an allowed domain are automatically allowed. A valid domain requires a host and must not include any path, port, query or fragment. Examples: 'example.com' or 'subdomain.example.com'
  *   `challengeSecurityPreference` (*type:* `String.t`, *default:* `nil`) - Optional. Settings for the frequency and difficulty at which this key triggers captcha challenges. This should only be specified for IntegrationTypes CHECKBOX and INVISIBLE and SCORE_AND_CHALLENGE.
  *   `integrationType` (*type:* `String.t`, *default:* `nil`) - Required. Describes how this key is integrated with the website.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allowAllDomains => boolean() | nil,
          :allowAmpTraffic => boolean() | nil,
          :allowedDomains => list(String.t()) | nil,
          :challengeSecurityPreference => String.t() | nil,
          :integrationType => String.t() | nil
        }

  field(:allowAllDomains)
  field(:allowAmpTraffic)
  field(:allowedDomains, type: :list)
  field(:challengeSecurityPreference)
  field(:integrationType)
end

defimpl Poison.Decoder,
  for: GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1WebKeySettings do
  def decode(value, options) do
    GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1WebKeySettings.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.RecaptchaEnterprise.V1.Model.GoogleCloudRecaptchaenterpriseV1WebKeySettings do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
